import axios from 'axios'

// const baseURL = "http://123.207.32.32:8000";
const baseURL = "http://localhost:3000";

export function request(config) {
    //创建axios的实例
    const instance = axios.create({
        baseURL,
        timeout:5000
    })
    //拦截器
    instance.interceptors.request.use(config => {
        return config
    },err => {
        return err
    })
    instance.interceptors.response.use(response => {
        return response.data
    },err => {
        return err
    })
    //发送真正的网络请求
    return instance(config)
}